#include "Ship.h"
using namespace poly;

void Ship::Particle::step(float dt)
{
	RigidCircle::step(dt);
	age += dt;
}


Ship::Ship( Dynamics * dyn ) :
	m_input( 0 ), m_dynamics( dyn )
{
}

void Ship::setInput( SInput & input )
{
	m_input = &input;
}

void Ship::step(float dt)
{
	SInput::KEYSTATE keys = m_input->keyState();
	if( keys.keys[DIK_RIGHT] & 0x80 )
		rigidBody.addForceLocal( float3( 0, +1.f, 0 ), float3( +1.5f, 0, 0 ) );
	if( keys.keys[DIK_LEFT] & 0x80 )
		rigidBody.addForceLocal( float3( 0, +1.f, 0 ), float3( -1.5f, 0, 0 ) );
	rigidBody.addForce( float3(0, -0.2, 0) );

	RigidPoly::step( dt );
}
